<template>
    <div>
        <span>传递的参数:{{$route.query.id}},{{$route.query.name}}</span>
        <input type="button" value="获取ref元素" @click="myClick"/>
        <br />
        <span ref="xlref">这是span标签</span>
        <h1>{{msg}}</h1>
        这事父组件的值：<input v-model="examleid"/>
        <watch-test :examleid.sync="examleid"></watch-test>
        <!--        <router-link to="/watchTest">子组件</router-link>-->
    </div>
</template>

<script>
    import WatchTest from "./WatchTest.vue";

    export default {
        components: {WatchTest},
        data() {
            return {msg: null,examleid:15}
        },
        created() {
            this.msg = '初始化'
        },
        methods: {
            myClick() {
                this.msg = this.$refs.xlref.innerHTML;
            }
        }
    }
</script>

<style scoped>

</style>
